#include <cassert>
#include <iostream>

using namespace std;

class Pnt {
  int a{0};

public:
  int print1() const { return a + 1; }
  int print2() const { return a + 2; }
  int print3() const { return a + 3; }
};

int pt(Pnt *p, int (Pnt::*print)() const) { return (p->*print)(); }

int main() {

  int (Pnt::*print)() const;
  print = &Pnt::print1;
  int count{0};
  Pnt *p = new Pnt;
  count += (p->*print)();
  print = &Pnt::print2;
  count += pt(p, print);
  count += pt(p, &Pnt::print3);
  cout << count << endl;
  return 0;
}